package com.cs.study.homework._0312;

import java.io.FileInputStream;

import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class Demo3 {
    public void callTargetMethod(String configFilePath) throws IOException, ClassNotFoundException, NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException {
        Properties properties = new Properties();
        properties.load(new FileInputStream("_0325/config.properties"));
        String className = properties.getProperty("className");
        String methodName = properties.getProperty("methodName");

        Class<?> aClass = Class.forName(className);
        Method method = aClass.getMethod(methodName);
        Object o = aClass.newInstance();
        method.invoke(o);



    }
}
